﻿using System;
using System.IO;

namespace GJXQGame
{
    public partial class ArenaBaseBase : IDataBase<byte>
    {
        public byte id;		//KEY
        public byte arenaWinPoints;		//竞技场胜利勋章
        public byte arenaLosePoints;		//竞技场失败勋章
        public string arenaScene;		//竞技场背景图
        public string arenaEffect;		//竞技场特效
        public string arenaBgm;		//竞技场背景音乐

        public ArenaBaseBase() { }
        //public uint getKeyValue() { return 0; }
        public byte GetID() { return id; }

        public bool ParseData(BinaryReader reader)
        {
            try
            {
                id = reader.ReadByte();
                arenaWinPoints = reader.ReadByte();
                arenaLosePoints = reader.ReadByte();
                {
                    byte[] buf = reader.ReadBytes(reader.ReadUInt16());
                    arenaScene = TableManager.Bytes2String(buf);
                }
                {
                    byte[] buf = reader.ReadBytes(reader.ReadUInt16());
                    arenaEffect = TableManager.Bytes2String(buf);
                }
                {
                    byte[] buf = reader.ReadBytes(reader.ReadUInt16());
                    arenaBgm = TableManager.Bytes2String(buf);
                }

            }
            catch
            {
                return false;
            }
            return true;
        }

    }
}
